<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <script src="vue.min.js"></script>
<script src="axios.min.js"></script>
    <div id="app">
        <table>
            <tr v-for="user in userList">
                <td>{{user.name}}</td>
                <td>{{user.age}}</td>
            </tr>
        </table>
    </div>
    <script src="vue.min.js"></script>
    <script>
        new Vue({
            el: '#app',
            data: {
                userList:[]
            },
            created(){//调用方法
                this.getList()
            },
            methods :{
                getList() {
                    axios.get('data.json')
                        .then(response =>{
                             console.log(response)
                             this.userList = response.data.data.items
                        })
                        .catch(error =>{
                            console.log('失败')
                        })
                }
            }
        })
    </script>
</body>

</html>